package com.qmhl.toolposition.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.qmhl.toolposition.databinding.FragmentMsgBinding
import com.qmhl.toolposition.fragment.msg.MsgFriendFragment
import com.qmhl.toolposition.fragment.msg.MsgSystemFragment

class MsgAdapter(private val fragmentActivity: FragmentActivity, private val count: Int) :
    FragmentStateAdapter(fragmentActivity) {

    override fun getItemCount(): Int {
        return count
    }

    override fun createFragment(position: Int): Fragment {
        return when (position) {
            0 -> MsgFriendFragment()
            1 -> MsgSystemFragment()
            else -> MsgFriendFragment()
        }
    }
}